﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ARCam3D
{
    public class ServiceProvider : IServiceProvider
    {
        private static ServiceProvider instance = new ServiceProvider();

        public static ServiceProvider Instance
        {
            get { return instance; }
        }


        private Dictionary<Type, object> services = new Dictionary<Type, object>();

        public void AddService<T>(T service)
        {
            services.Add(typeof(T), service);
        }

        public object GetService(Type serviceType)
        {
            object service;

            services.TryGetValue(serviceType, out service);

            return service;
        }
    }
}
